#pragma once

class IAsyncCalc;
class SDL_Thread;

struct AsyncTask
{
	IAsyncCalc*		m_task;
	uint	m_arg;
	SDL_Thread*		m_thread;

	AsyncTask() :
		m_task(NULL),
		m_arg(0),
		m_thread(NULL)
	{}
};

class IAsyncCalc
{
public:
	IAsyncCalc();
	~IAsyncCalc();

	void StartAsync(uint arg);
	void OnAsyncFinished(uint arg);

	virtual uint OnAsyccCalc(uint arg) = 0;
	virtual void OnAsyncReady(uint arg) = 0;

private:
	AsyncTask*	m_description;
};

int AsyncCalc(void* data);